The present invention relates to the high-speed printing industry, and more particularly, to a method for printing variable data using a page description language in a high-speed printing environment.
Application programs, such as Adobe Illustrator(copyright), typically include a program which generates a specification of a screen or page""s contents in a page description language. The specification, or page description code, provides instructions as to how to generate the image in a printer. The page description code is transferred from the application program to a printer, where it is executed to generate a bit map of the page. The most commonly used page description language is PostScript(copyright), which is a machine independent language produced by Adobe Systems, Inc.
An application program page typically contains a number of data areas with either graphic or alphanumeric data. The PostScript language includes commands that define or build xe2x80x9cgraphics statesxe2x80x9d for each of the data areas on the page. These graphics states are sets of default attributes such as angle, scale factor, type-font, location, etc., which define how data is to appear on the page. Often, multiple graphics states are defined for a single page, with the different graphic states corresponding to different data areas on the page. Examples of commands that are used in PostScript to build a graphics state are: 20 rotate, /Times-Roman findfont, 14 scalefont, and setfont. In addition to commands which build graphics states, PostScript specifications also include the graphic or alphanumeric data which is displayed in the data areas, as well as a print command such as xe2x80x9cSHOWxe2x80x9d, which causes a bit map to be generated for the data.
In the past, page description languages, including PostScript, have only been used to print static data pages, because page description languages lack the functionality required for variable data printing. In variable data printing, each page shares a common background, and the displayed data in at least one data field changes for each page. Up until now, it has not been possible to print pages of variable data with page description languages such as PostScript, because the page description languages are unable to save page backgrounds and graphics states from a page specification, and are thus unable reuse the same background and graphics states when printing subsequent pages. Thus, with page description languages such as PostScript, whether the entire page is changed, or only a single item of data on the page is changed, a new page description language specification is generated to print each separate page.
For example, if thousands of copies of a mass mailing advertisement were to be printed, each copy being identical except for the recipient""s name and address, it would be necessary to generate a new PostScript specification defining the page background, and the graphics states for the name and address fields, for each new name and address that is printed. Hence, to print 50 advertisements, it would be necessary to generate 50 PostScript specifications which each define virtually the same image.
In general, PostScript specifications are very complex and require extensive processing to generate and execute. Thus, generating a new PostScript specification each time a page of variable data is printed consumes an immense amount of processing time. In high-speed printing systems, it is typically the processing time, not the printer hardware, which determines the speed at which pages can be printed. Therefore, the processing required to repetitively redefine the same background and graphics states for each page of variable data significantly slows the entire printing system.
Due to the amount of processing time consumed in redefining the page template and graphics states for each new page of data that is printed, as well as the resultant effect on printing speed, it is desirable to have a method for processing variable data wherein once defined, the template and graphics states for a page can be stored and reused for printing subsequent pages. Further, it is desirable to have a method for printing variable data which is compatible with existing printing systems and page description languages, such as PostScript, and which is capable of processing variable data in a high-speed industrial printing system.
It is an object of the present invention to provide a method for utilizing variable data with a page description language, which enables the template and graphics states for a page of variable data to be defined and stored; and which enables the stored graphics states to be associated with multiple items of variable data from a database or merge file; so that once stored, the graphics states can be repeatedly applied to the items of variable data to print multiple pages of variable data or multiple variable data bitmaps. Further, it is an object of the present invention to provide such a method which is compatible with existing page description languages, and which can be used in a high-speed industrial printing system.
The method of the present invention is implemented by means of a control task which executes in conjunction with a page description code interpretive program, such as a PostScript program, to identify variable data areas in the page description code specification, and reserve the graphics states for the variable data areas as they are defined by the specification. After the interpreter program has executed, a merge task is initiated. The merge task associates items of variable data from a data file with the reserved graphics states, generates a bit map for each variable data area, merges the bit maps with the page template, and outputs a complete bit map for the page. Accordingly, in the method of the present invention, bit maps for multiple pages of variable data are generated from a single page description language specification.
The present invention assumes the generation of a page specification in PostScript, or another similar page description language, by the application program, and the transfer of this specification to a printer. According to the present invention, a control task activates and monitors the PostScript interpreter program in the printer. As the interpreter executes, it defines graphics states for the data areas on the page. The PostScript attributes for a graphics state are stored in a stack as they are defined, so that at any given point in the code, the stack represents all of the PostScript attributes for the current graphics state.
When the control task identifies a print command in the code, the control task interrupts the interpreter to determine whether the data to be printed is variable data. If the data is variable, the current graphics state, consisting of the attributes then existing in the stack and job specific attributes which are defined in a job file, is linked to the data area and reserved in an internal database. Further, character bit maps are generated in accordance with the graphics state, and linked to and reserved with the graphics state. After the graphics state and character bit maps have been reserved, the PostScript interpreter is resumed at the line of code following the print command.
The interpreter continues executing until either the control task detects another print command, or the last line of code is reached. If a second print command is detected, the interpreter is interrupted again and the above steps repeated, to reserve the stack contents and job attributes for the second data area, and to generate and store a second set of character bit maps. The control task continues in this manner monitoring and interrupting the interpreter program, until all of the variable data areas on the page have been detected, and graphics states and possibly character bit maps for the variable data areas have been reserved in the database.
As the PostScript interpreter executes, a bit map of the non-variable background graphics and text, otherwise referred to as a xe2x80x9ctemplatexe2x80x9d, is generated for the page. At the last code command, which in PostScript is typically xe2x80x9cSHOWPAGE,xe2x80x9d the control task terminates the PostScript interpreter, and reserves the template in the database.
The merge task is then initiated to print variable data pages using the reserved page template, graphics states and character bit maps. The merge task begins by retrieving a merge file containing the variable data to be printed. After retrieving the merge file, the task identifies the correct template for the current page, and the names of the graphics states related to that template, from data in the merge file. Then, using the name of the first graphics state reserved for the template, the merge task retrieves the graphics state from the database and the character bit maps linked to that state. The merge task then retrieves data corresponding to that graphics state from the appropriate field in the merge file, and generates a bit map of the data in accordance with the graphics state and character bit maps. The merge task then merges the data bit map into the template. After the bit map has been generated and merged, the merge task identifies retrieves another graphics state for the template and repeats the process. If there are no more graphics states which correspond to variable data areas on the page, the merge task outputs the finished bit map for the page.
After the first page of data has been printed, the merge task retrieves a xe2x80x9ccleanxe2x80x9d template from the database, and again identifies the graphics states for the page. The merge task then retrieves the next record of variable data from the database, and generates variable data bit maps for each of the fields in the record, in accordance with the reserved graphics states and character bit maps which correspond to each of the fields. The merge task continues in this manner, identifying variable data areas and generating bit maps for the variable data in the merge file, until a page has been printed for each variable data record in the file.
The method of the present invention is advantageous in that once the graphics states and template have been defined for a variable data page, they can be reused to print multiple pages of variable data with only a minimal amount of additional processing.
Accordingly, it is an object of the present invention to provide a method for printing variable data with a page description language; a method which increases the speed at which variable data pages can be printed; a method which enables the printing attributes for a page to be saved and used for printing multiple pages of data; and a method which is compatible with existing page description languages and printing systems.
Other objects and advantages of the present invention will be apparent from the following description, the accompanying drawings and the appended claims.